<?php

namespace addon\lian\dict;


/**
 * 链动2+1公共属性
 */
class LianDict
{

    //状态（正常）
    const NORMAL = 1;
    //状态（冻结）
    const FREEZE = -1;

    /**
     * 状态
     * @param $status
     * @return array|mixed|string
     */
    public static function getStatus($status = ''){
        $list = [
            self::NORMAL => '正常',
            self::FREEZE => '冻结',
        ];

        if($status) return $list[$status] ?? '';
        return $list;
    }

    //结算周期：天/周/月
    const DAY = '0';

    const WEEK = '1';

    const MONTH = '2';

    public static function getSettleTime($time = ''){
        $list = [
            self::DAY => '天',
            self::WEEK => '周',
            self::MONTH => '月',
        ];
        if($time) return $list[$time] ?? '';
        return $list;
    }

    //结算方式：营业额/利润
    const TURNOVER = '0'; //营业额

    const PROFIT = '1'; //利润

    public static function getSettleType($type = ''){
        $list = [
            self::TURNOVER => '营业额',
            self::PROFIT => '利润',
        ];
        if($type) return $list[$type] ?? '';
        return $list;
    }


    //计算方式：支付金额，商品现价，商品原价
    const ORDERMONEY = '0'; //支付金额

    const GOODSPRICE = '1'; //商品现价

    const GOODSORIGINALPRICE = '2'; //商品原价

    public static function getCountType($type = ''){
        $list = [
            self::ORDERMONEY => '支付金额',
            self::GOODSPRICE => '商品现价',
            self::GOODSORIGINALPRICE => '商品原价',
        ];
        if($type) return $list[$type] ?? '';
        return $list;
    }




    //提成类型 余额/佣金/积分
    const MONEY = '0'; //余额

    const COMMISSION = '1'; //佣金

    const SCORE = '2'; //积分

    const INTEGRAL = '3'; //数字积分
    
    public static function getTakeType($type = ''){
        $list = [
            self::MONEY => '余额',
            self::COMMISSION => '佣金',
            self::SCORE => '积分',
            self::INTEGRAL => '数字积分',
        ];
        if($type) return $list[$type] ?? '';
        return $list;
        
    }

    const ORDERPAY = '0'; //订单支付后

    const ORDERFINISH = '1'; //订单完成

    const ORDERREFUND = '2'; //订单退款

    public static function getUpWay($type = ''){
        $list = [
            self::ORDERPAY => '订单支付后',
            self::ORDERFINISH => '订单完成',
            self::ORDERREFUND => '订单退款',
        ];
        if($type) return $list[$type] ?? '';
        return $list;
    }


}
